package com.fuxian.dao.mybatisImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import com.fuxian.dao.LessonclassifDao;
import com.fuxian.model.Lessonclassifcation;

@Repository
public class LessonclassifDaoMybatisImpl implements LessonclassifDao {

	@Resource
	private SqlSessionTemplate sqlSessionTemplate;
	public void addLessonclassifcation(Lessonclassifcation lessonclassif) {
		sqlSessionTemplate.insert("addLessonclassifcation", lessonclassif);
	}

	public void deleteLessonclassifcationById(int id) {
		sqlSessionTemplate.delete("deleteLessonclassifcationById", id);
	}

	public void modifyLessonclassifcation(Lessonclassifcation lessonclassif) {
		sqlSessionTemplate.update("modifyLessonclassifcation", lessonclassif);
	}

	public List<Lessonclassifcation> selectAlllessonclassifcation(int start,
			int size) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("start", start);
		map.put("size", size);
		List<Lessonclassifcation> list = sqlSessionTemplate.selectList(
				"selectAlllessonclassifcation", map);
		return list;
	}

	public Lessonclassifcation selectLessonclassifcationById(int id) {
		return sqlSessionTemplate.selectOne("selectLessonclassifcationById", id);
	}

	public int selectCount() {
	return	sqlSessionTemplate.selectOne("selectCount");
	}

}
